The present invention relates to a portable electronic apparatus such as an IC card which receives externally transmitted messages and executes various processes in accordance with commands contained in the received messages, and a message processing method.
IC cards are expected to come into wide use in the future. With this expectation, various proposals have been made concerning IC cards. In general, important data demanding high security, e.g., a password, is often stored in an IC card. In rewriting such important data demanding high security, as techniques of protecting the important data against interception or tampering by a third party, for example, the following are known: a technique of encrypting the data string of the important data; and a technique of adding auxiliary data for a validity check to the important data.
The above techniques are defined by commands. One IC card can use only one type of message format. Assume that the execution of the technique of encrypting data strings or the technique of adding auxiliary data is defined by a command in a given IC card. In this IC card, therefore, even when the data is to be rewritten into data with low security, the technique of encrypting data strings or the technique of adding auxiliary data is used.
The present invention has been made to solve the above problem, and has as its object to provide a portable electronic apparatus and message processing method which can decode a plurality of message formats.
According to the present invention, there is provided a portable electronic apparatus comprising reception means for receiving a message, identification means for identifying a message format of the message received by the reception means, and processing means for decoding a command of the message received by the reception means on the basis of the message format identification result obtained by the identification means, and performing processing in accordance with the decoded command.
In addition, according to the present invention, there is provided a message processing method comprising the first step of receiving a message, the second step of identifying a message format of the message received in the first step, and the third step of decoding a command of the message received in the first step on the basis of the message format identification result obtained in the second step, and performing processing in accordance with the decoded command.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.